#ifndef DBT_H
#define DBT_H

#include <stdint.h>

 #ifdef __cplusplus
 extern "C" {
 #endif 

//Initializes the DBT mechanism. This should be called upon program startup
//and. Call this only once.

void DBT_Init();

//This function is the main entry point for DBT execution.
//It must be called from the main NES emulation loop
//exactly in the same places the interpretation code is called
//(runCycles, defined in 6502.c). Therefore, this can
//be invoked through a function pointer for cycle execution,
//allowing both DBT and interpreted versions to be linked
//into the same executable, without sacrificing performance.

//NOTE: By design, this function is not cycle-accurate in favor of
//speed. However, it should be enough for most software, except
//for games which relies a lot on PPU/IRQ/Mapper trickery. In other words
//it tries to emulate the amount of Cycles required, although 
//this is not guaranteed

int32_t DBT_runCycles(int32_t Cycles);

#ifdef __cplusplus
}
#endif

#endif
